package com.mjw.tender.feign;

import com.mjw.tender.domain.TbUser;
import com.mjw.tender.dto.ResponseResult;
import com.mjw.tender.feign.fallback.Oauth2FeignFallBackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(value = "business-oauth2-service",path = "/api")
//        configuration = Oauth2FeignFallBackFactory.class,
//        fallbackFactory = Oauth2FeignFallBackFactory.class)
public interface Oauth2Feign {

    /**
     * 获取用户信息，姓名和头像
     * @return
     */
    @GetMapping("/info")
    public ResponseResult getUserInfo();

    @PostMapping(value = "/user")
    public ResponseResult<Long> addUserReturnId(@RequestBody TbUser tbUser);

}
